package cn.pacerx.running.db.enums;

import lombok.Getter;

/**
 * 事件重复类型
 */
@Getter
public enum RepeatTypeEnum {
    NONE(0),
    WEEKLY(1),
    MONTHLY(2),
    YEARLY(3);

    private final int value;

    RepeatTypeEnum(int value) {
        this.value = value;
    }

    public static RepeatTypeEnum getByValue(int code) {
        for (RepeatTypeEnum e : values()) {
            if (e.value == code) {
                return e;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + code);
    }
}
